import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    // 开启热模块替换
    hmr: true,
    // 代理配置，用于API请求转发
    proxy: {
      '/VueHandler': {
        target: 'http://localhost:3000',
        changeOrigin: true,
        rewrite:(path)=>path.replace(/^\/VueHandler/,"")
      },
    }
  }
})
